//***************************************************************************
//*
//*	File:			DialogProjects.h
//*	Description:	Dialog for managing projects
//*
//***************************************************************************
//*
//*	Note:			This source code is provided "as is" meaning that you may 
//*					use it at your own risk. 
//*					You are free to use it in any way you like.
//*
//***************************************************************************
//*
//*	History:		
//*
//*	-------------------------------------------------------------------------
//*	2003/07/27	|	Initial release									|	rk
//*	-------------------------------------------------------------------------
//*
//***************************************************************************

//
//-------------------------------------------------------------- PREPROCESSOR 
//

#ifndef			__DIALOGPROJECTS_H_INCLUDED
#define			__DIALOGPROJECTS_H_INCLUDED

#if				_MSC_VER > 1000
#pragma once
#ifdef			__SWITCH_SHOW_HEADER
#pragma message ("-- DialogProjects.h\n")
#endif
#ifdef			__SWITCH_SHOW_HEADER_TREE
#pragma message ("-- "__FILE__"\n")
#endif
#endif 

//
//-------------------------------------------------------------- DEPENDENCIES
//

//
//--------------------------------------------------------- CLASS DECLARATION
//

//***************************************************************************
//**	@DOC		CLASS CDialogProjects
//***************************************************************************
//*		@CLASS		Dialog for managing configurations
//**	@BASE		Dialog
//***************************************************************************
class CDialogProjects : public CDialog
{
	DECLARE_EASYSIZE

	//																									
	//-----------------------------------------------------------------------							
	//***************************     ATTRIBS     ***************************							
	//-----------------------------------------------------------------------							
	//																									
private:																					// @ACCESS	Private Attributes	
	//{{AFX_DATA(CDialogProjects)
	enum { IDD = IDD_PROJECTS };
	CListCtrl		m_ctrlListWorkspaces;
	//}}AFX_DATA

	IApplication*	m_pIApplication		;
	CImageList		m_ImageList			;

	//																							
	//-----------------------------------------------------------------------					
	//***************************     GET/SET     ***************************					
	//-----------------------------------------------------------------------					
	//																							
public:																						// @ACCESS	Public Get/Set Methods	
	void SetApplication	( IApplication*		a_pIApplication			)			;			// @CMEMBER	Sets the pointer to the application's interface

	//																							
	//-----------------------------------------------------------------------					
	//*************************     PERISTENCE     **************************					
	//-----------------------------------------------------------------------					
	//																							
private:																					// @ACCESS	Private Persistency Methods	
	void LoadProfile	( void )												;			// @CMEMBER	Loads profile settings from the registry
	BOOL WriteProfile	( void )										const	;			// @CMEMBER	Saves profile settings to   the registry

	BOOL ImportBuilds	( const CString&	a_strPath				)			;			// @CMEMBER	Imports settings from a file
	BOOL ExportBuilds	( const CString&	a_strPath				)	const	;			// @CMEMBER Exports settings to   a file

	//																							
	//-----------------------------------------------------------------------					
	//***************************     HELPERS     ***************************					
	//-----------------------------------------------------------------------					
	//																							
private:																					// @ACCESS	Private Helper Methods	
	BOOL AddWorkspace	( const CString&	a_strPath
						, const CString&	a_strName				)			;			// @CMEMBER	Adds the specified workspace to the dialog
	void AddProject		( const CString&	a_strWorkspacePath
						, const CString&	a_strWorkspaceName
						, const CString&	a_strProjectPath
						, const CString&	a_strProjectName
						, const CString&	a_strConfigurations
						,		int			a_iStyle = 0x01			)			;			// @CMEMBER	Adds the specified project to the dialog
	void GetProject		(		int			a_iProject
						,		CString&	a_strWorkspacePath
						,		CString&	a_strWorkspaceName
						,		CString&	a_strProjectPath
						,		CString&	a_strProjectName
						,		CString&	a_strConfigurations
						,		int&		a_iStyle				)	const	;			// @CMEMBER	Obtains the specified project from the dialog
	void MoveItem		(		int			a_iSrc
						,		int			a_iDst					)			;			// @CMEMBER	Swaps the specified items' contents

	//																							
	//-----------------------------------------------------------------------					
	//**************************     VIRTUALS     ***************************
	//-----------------------------------------------------------------------					
	//																							
	//{{AFX_VIRTUAL(CDialogProjects)
protected:																					// @ACCESS	Protected Overridables
	virtual void DoDataExchange			( CDataExchange* pDX );								// @CMEMBER	DDX/DDV Support
	//}}AFX_VIRTUAL

	//																							
	//-----------------------------------------------------------------------					
	//**************************     MESSAGES     ***************************
	//-----------------------------------------------------------------------					
	//																							
protected:																					// @ACCESS	Protected Message Handlers
	//{{AFX_MSG(CDialogProjects)
	virtual BOOL OnInitDialog			();
	afx_msg void OnAddProject			();
	afx_msg void OnImport				();
	afx_msg void OnExport				();
	virtual void OnOK					();
	afx_msg void OnRemoveProject		();
	afx_msg void OnMoveUp				();
	afx_msg void OnMoveDown				();
	afx_msg void OnClickWorkspaceList	(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSize					(UINT nType, int cx, int cy);
	afx_msg void OnGetMinMaxInfo		(MINMAXINFO FAR* lpMMI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

	//																						
	//-----------------------------------------------------------------------				
	//***********************     CON/DESTRUCTION     ***********************				
	//-----------------------------------------------------------------------				
	//																						
public:																						// @ACCESS	Public Con-/Destruction Methods	
	CDialogProjects( CWnd* pParent = NULL );												// @CMEMBER	Default constructor
};

//{{AFX_INSERT_LOCATION}}

#endif // #ifndef			__DIALOGPROJECTS_H_INCLUDED
